<div class="al-modal-view">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" ng-click="cancel()">
      <span aria-hidden="true" class="glyphicon glyphicon-remove"></span>
      <span class="sr-only">Close</span>
    </button>
    <h4 class="modal-title ok-color">{{modalTitle}}</h4>
  </div>
  <div class="modal-body">
    <ng-form name="modalForm" class="form-horizontal form-validation" role="form">
      <div class="form-group">
        <label class="col-sm-3 control-label">账号<span class="attr-need">*</span></label>
        <div class="col-sm-8">
          <input class="form-control" ng-model="data.username" type="text"
                 ng-required="true" name="roleName" ng-disabled="judge()"
                 placeholder="" maxlength="50"/>
          <div class="help-block with-errors"
               ng-if="modalForm.roleName.$invalid && !modalForm.roleName.$pristine">
            账号不可为空
          </div>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">名称<span class="attr-need">*</span></label>
        <div class="col-sm-8">
          <input class="form-control" ng-model="data.nickname"  placeholder="">
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">密码<span ng-if="type=='new'" class="attr-need">*</span></label>
        <div class="col-sm-8">
          <input class="form-control" ng-model="data.password"
                 ng-required="type=='new'" name="password" ng-pattern="/[0-9|A-Z|a-z]{6,16}/"
                 placeholder="" maxlength="50">
          <div class="help-block with-errors"
               ng-if="modalForm.password.$invalid && !modalForm.password.$pristine">
            创建用户密码必须为6-12位字母或数字
          </div>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">门店</label>
        <div class="col-sm-8">
          <select ng-model="data.store" class="form-control"
                  ng-options="option.id as option.name for option in apartmentList"></select>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">性别</label>
        <div class="col-sm-8">
            <select ng-model="data.sex" class="form-control"
                    ng-options="option.value as option.name for option in sexList"></select>
          </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">邮箱</label>
        <div class="col-sm-8">
          <input type="email" class="form-control" name="email" ng-model="data.email"
                 placeholder="">
          <div class="help-block with-errors"
               ng-if="modalForm.email.$invalid && !modalForm.email.$pristine">
            邮箱是非法的
          </div>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">手机</label>
        <div class="col-sm-8">
          <input class="form-control" ng-model="data.phone"
                 name="phone" ng-pattern="/[0-9]{11}/" placeholder="">
          <div class="help-block with-errors"
               ng-if="modalForm.phone.$invalid && !modalForm.phone.$pristine">
            手机要求是11位
          </div>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">员工编号</label>
        <div class="col-sm-8">
          <input class="form-control" ng-model="data.buzCode"
                 name="buzCode" placeholder="" maxlength="20">
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">员工部门</label>
        <div class="col-sm-8">
          <input class="form-control" ng-model="data.org"
                 name="org" placeholder="" maxlength="11">
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">状态</label>
        <div class="col-sm-8">
          <nobr>
            <label class="ui-radio" ng-repeat="option in modalEnabledList">
              <input name="enabled" ng-value="option.value" type="radio" ng-model="data.enabled">
              <span>{{option.name}}</span>
            </label>
          </nobr>
        </div>
      </div>
    </ng-form>
  </div>
  <div class="modal-footer">
    <button class="btn btn-warning no-border" type="button" ng-click="cancel()">取消</button>
    <button class="btn btn-primary no-border" type="button" ng-click="confirm()" ng-disabled="modalForm.$invalid">确定</button>
  </div>
</div>